package com.stoney.support;

import com.stoney.utils.UrlUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Stony on 2015/11/23.
 */
public class ImgAndFontMatcher {

    public static final String regex = "(url[(]{1}[\"']?)([./a-zA-Z0-9-_?=#&:]+)(['\"]?[)]{1})";

    public List<String> matcher(String html){
        java.util.regex.Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(html);
        List<String> list = new ArrayList<String>();
        while(matcher.find()){
            String url = (matcher.group(2));
            list.add(url);
        }
        return list;
    }

}
